UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EFkIAh0P7/AYZCl/qGg5ClEv1GaXvD2HnRHPbjNlU+k='
WHERE
key_id = 'c4be3a23dc724a5fa4d8ba12a783815a1ed43ede9f8dc08369cb55d408c8d519'
AND (
token = 'EFkIAh0P7/AYZCl/qGg5ClEv1GaXvD2HnRHPbjNlU+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)