UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mZ4MErtbqb/hI/r9VzwLPUwk1jrvYihzKbZ0W8f96EI='
WHERE
key_id = 'fd20c3b2d97333b08c37430bdd9b9d8396841281a3d57c3b26e27d4e1b88de5d'
AND (
token = 'mZ4MErtbqb/hI/r9VzwLPUwk1jrvYihzKbZ0W8f96EI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)