UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2wEYldxitaazGFzMC0X9DIdRnG50G00u0OUiLr27CR4='
WHERE
key_id = '5b26e0c4fc09c6b6035b406c2e3b13ee3c0a6653b48f49fcd5be752f52974285'
AND (
token = '2wEYldxitaazGFzMC0X9DIdRnG50G00u0OUiLr27CR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)