UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qn5vOitlYQLDcSdMZr9WrUKNFYjirCn1PNQopNBMfdM=' 
WHERE 
  key_id = '0e546e37178b8748cf231a43d987973f436aea015ac7f4ef61f06a4f9e2ad27e' 
  AND (
    token = 'qn5vOitlYQLDcSdMZr9WrUKNFYjirCn1PNQopNBMfdM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046