UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1iR7BYcuIloA62f2Gr0IYoRJlSE175s7x1evORdsOlo=' 
WHERE 
  key_id = '645ef96cd671e6258f265bd0115ed41f12f1bcd00c0e01cbf9ea666eb2698d63' 
  AND (
    token = '1iR7BYcuIloA62f2Gr0IYoRJlSE175s7x1evORdsOlo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037