UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yicvpKxU4Epdpu4eL9RjHVR+JMibSJEjSrG7Ir9kYUI='
WHERE
key_id = '0b25e8c38df15b7a9b01acf5f07a47758bf9d763082e71e63c531fbb907fcb52'
AND (
token = 'yicvpKxU4Epdpu4eL9RjHVR+JMibSJEjSrG7Ir9kYUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)