UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/J35MOWlBmCUgIEynyPHY3P0oyDR3BpRH1zy8KW2Nyc=' 
WHERE 
  key_id = '8ee0c4caee1db492625b890fa01b16718d62008dbabedd0436637dae73a2f4d7' 
  AND (
    token = '/J35MOWlBmCUgIEynyPHY3P0oyDR3BpRH1zy8KW2Nyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021