UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dPkA3pZ6Ev/lbTyfEESWMX3SEiigWFFhE3EBAOzi8xw=' 
WHERE 
  key_id = '8956cf4f6ce3917a3f0f49b79a8337da2a67278bfff1fd23695e2083e39b1c51' 
  AND (
    token = 'dPkA3pZ6Ev/lbTyfEESWMX3SEiigWFFhE3EBAOzi8xw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033