UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ro+Vc/yFZ/rViOSLwHUieyY8HaWhwytBUNdnFfVpMBg='
WHERE
key_id = '50659884107f66e2776b1c69ffec40112415a93e8ca61a769a00d6351798dd07'
AND (
token = 'Ro+Vc/yFZ/rViOSLwHUieyY8HaWhwytBUNdnFfVpMBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)