UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CoJ7BFM6Rd1dJnRz7Yh1sY7emMisWdlWHI5wxsgbKm0='
WHERE
key_id = 'ae0262d210d4e1c4c07e93638db79c6ae0aa3215065e1a6d8bb78383b0d13955'
AND (
token = 'CoJ7BFM6Rd1dJnRz7Yh1sY7emMisWdlWHI5wxsgbKm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)