UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g4J6KRGrVBeO0LJpWBBYwgBxS7YJKHnaNZ/17JiJDEY='
WHERE
key_id = '437013c59844f7fbe4d5c1d97827ebfbefb9c036cb6102869bb812af326eaff2'
AND (
token = 'g4J6KRGrVBeO0LJpWBBYwgBxS7YJKHnaNZ/17JiJDEY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)