UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VXnqYNA2rEdH0BGCd+hJjaqOxjKGiudl9M+sEa+lnxQ=' 
WHERE 
  key_id = '7dfb16149a1cd4475b30bc63578ceda19f0847aada75d1528b0fd81e53bbc066' 
  AND (
    token = 'VXnqYNA2rEdH0BGCd+hJjaqOxjKGiudl9M+sEa+lnxQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034