UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mE5A828xIOCu2kHBSmqU8QsaMVJ8eAFWBsw7lLEBL/I='
WHERE
key_id = '9f7f0980382234501b4fbf58332167b963c8b9b8e144bc8ab96e8b3dc8810b50'
AND (
token = 'mE5A828xIOCu2kHBSmqU8QsaMVJ8eAFWBsw7lLEBL/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)