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

Query time 0.00041