UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3c7GyJKdgsRVxnoV21KSTElSk6HzxTyXy5ZOwTGkYbU=' 
WHERE 
  key_id = 'f43c492ffa3ff4106242bdd739a1e584ff288f3d660bb74e870d212e0bbfc8d3' 
  AND (
    token = '3c7GyJKdgsRVxnoV21KSTElSk6HzxTyXy5ZOwTGkYbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046