UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cUWQ/PBLl0X2+WDBqdfilArrLKC1kC83aCu5D8HgRLg=' 
WHERE 
  key_id = '30760917be91d8f30f756aadc18cbe700c982380d98d36f33350d1f5a2a6275f' 
  AND (
    token = 'cUWQ/PBLl0X2+WDBqdfilArrLKC1kC83aCu5D8HgRLg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025