UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rZeGyARZjhS7vlKl7cZ1DqSwndBDbuCMpYOlNbe2zcg='
WHERE
key_id = '8432c2c3d66612349c62e63173b7ee0b2ae894eca1bf32c06232b2d9c2543374'
AND (
token = 'rZeGyARZjhS7vlKl7cZ1DqSwndBDbuCMpYOlNbe2zcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)