UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZqP+4l5CnnJKQIpHdA9DmtQH1xtD7FSx70jT2JWuyoY=' 
WHERE 
  key_id = 'b14a5a210aae2c81ce320fd0eb77bf39269561934f41dcb803ec9f8ef60e9998' 
  AND (
    token = 'ZqP+4l5CnnJKQIpHdA9DmtQH1xtD7FSx70jT2JWuyoY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042