UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uKyEtYwGsc7WssDxyGIhzFbY/Ljz2+I+CW0XT4hfmmk='
WHERE
key_id = 'f873ca1155c101dce0980a1c0a20cb4c00eec9c70bbca3aa3c260d162def90d4'
AND (
token = 'uKyEtYwGsc7WssDxyGIhzFbY/Ljz2+I+CW0XT4hfmmk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)