UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bradpVMLcH+H+0CX6KzbzMOSVAs/qkGJTHUly38W2cQ='
WHERE
key_id = '35f623dc796669cacc66ed6400f2302a4361f84dfb404cb5f020ef5a7edf317d'
AND (
token = 'bradpVMLcH+H+0CX6KzbzMOSVAs/qkGJTHUly38W2cQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)