UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7KpdKWMaxnrloc22qblO7VHyzJ6jmDnS6BTt/XLoA38='
WHERE
key_id = '2f36603e95c5f4edeb59b5fe539cc0362ac2cf8a9fe5a7f16447f6dafbbc11c7'
AND (
token = '7KpdKWMaxnrloc22qblO7VHyzJ6jmDnS6BTt/XLoA38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)