UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f9ZvDtrufqcBK73uBmgyM2QVAazDjm9htH5hU3Y0LYI=' 
WHERE 
  key_id = '175b7b80036d2cf921ac8c91cdac33336dfef453b3769a90c2d54d8b7bfbaf76' 
  AND (
    token = 'f9ZvDtrufqcBK73uBmgyM2QVAazDjm9htH5hU3Y0LYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020