UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6ZRka5lIp4GZkSyd/MTaarQisvEbM1Cgx6BOD+PZBlY=' 
WHERE 
  key_id = '7403379cb3071fdb4032223fcc79acdf82a25e897f8c89c08041e45bd3cd2d76' 
  AND (
    token = '6ZRka5lIp4GZkSyd/MTaarQisvEbM1Cgx6BOD+PZBlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032