UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mmi/lQgnJsLtnGO1YQXpfKp0q5bee6T4Z+iAgzu1BZk='
WHERE
key_id = 'd233779a64496127776e5b8111d55c56c051814f4fd388a99642d1daeb226bf9'
AND (
token = 'mmi/lQgnJsLtnGO1YQXpfKp0q5bee6T4Z+iAgzu1BZk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)