UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CFTe35Cm8Q64dxoxrIWFpIeet/AI6waxv7FXksqdXLM='
WHERE
key_id = 'd517c0069f1e2ea78edd7ba8e3e652d208a6d445a5349a962180d496b3f39461'
AND (
token = 'CFTe35Cm8Q64dxoxrIWFpIeet/AI6waxv7FXksqdXLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)