UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RpkPXPDjYiIy3HjFoVIYX7HOcGcWr3cnAjMi99XTI78='
WHERE
key_id = '92104cf7a628ebb0f77b98ea21878a88bed6eed9dbf42c54aa44bd4ea629bbca'
AND (
token = 'RpkPXPDjYiIy3HjFoVIYX7HOcGcWr3cnAjMi99XTI78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)